import com.IoC.demo.UserService;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class Test2 {
    public static void main(String[] args) {
        // 1. 得到 Spring 上下文对象
        BeanFactory context =
                new XmlBeanFactory(new ClassPathResource("spring_config.xml"));
        // 2. 获取 Bean
        UserService userService = context.getBean("user",UserService.class);
//        // 3. 使用 Bean
//        userService.sayHi();
}
}
